let Image = require('Image');

let Type = cc.Enum({
    NONE: -1,
    O: -1,
    X: -1,
});

let Chessman = cc.Class({
    extends: cc.Component,

    properties: {
        image: Image,
        _type: Type.NONE,
        type: {
            type: Type,
            get() {
                return this._type;
            },
            
            set(value) {
                if (value === this._type || (value < Type.NONE || value > Type.X)) {
                    return;
                }
                this._type = value;
                this.image.index = value;
            }
        }
    },

    start () {

    },
});

